package com.carboncntr.tables;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table (name="CARB_ORDER")
public class Order {

	private int orderId;
	private Date entryDate;
	private BigDecimal carbonAmt;
	private BigDecimal price;
	private Date lastMod;
	private Customer customer;

	@Id 
	@GeneratedValue
	@Column (name="ORDER_ID")
	public int getOrderId() {
		return orderId;
	}
	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name="ENTRY_DATE")
	public Date getEntryDate() {
		return entryDate;
	}
	public void setEntryDate(Date entryDate) {
		this.entryDate = entryDate;
	}
	
	@Column(name="CARBON_AMT")
	public BigDecimal getCarbonAmt() {
		return carbonAmt;
	}
	public void setCarbonAmt(BigDecimal carbonAmt) {
		this.carbonAmt = carbonAmt;
	}

	@Basic
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name="LAST_MOD")
	public Date getLastMod() {
		return lastMod;
	}
	public void setLastMod(Date lastMod) {
		this.lastMod = lastMod;
	}
	
	@ManyToOne
	@JoinColumn(name="Cust_ID")
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer= customer;
	}

	
	
}
